<!DOCTYPE HTML>
<html>
<head>
<{include file='mobile/default/lib/meta.html'}>
<title>咨询反馈详情 - <{$GLOBALS.cfg.site_name}></title>
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/general.css" />
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/iconfont/iconfont.css">
<link rel="stylesheet" type="text/css" href="<{$common.theme}>/css/user.css" />
<script type="text/javascript" src="<{$common.theme}>/js/zepto.min.js"></script>
<script type="text/javascript" src="<{$common.theme}>/js/verydows.mobile.js"></script>
<script type="text/javascript">
$(function(){
  preserveSpace('footact');
});

function sendMessage(){
  var id = '<{$feedback.fb_id}>', content = $('#send-content');
  var checker = content.vdsFieldChecker({rules: {required:[true, '消息内容不能为空'], maxlen:[500, '消息内容不能超过500个字符']}});
  if(checker){
    $.vdsPrompt({content:checker});
    return false;
  }
  $.asynInter("<{url c='api/feedback' a='messaging'}>", {id:id, content:content.val()}, function(res){
    if(res.status == 'success'){
      if($('#msgli').find('.nodata').size() > 0) $('#msgli').empty();
      $('#msgli').append(juicer($('#msg-tpl').html(), {content:content.val(), dateline:res.dateline}));
    }else{
      $.vdsPrompt({content:res.msg});
    }
  });
}
</script>
</head>
<body>
<div class="wrapper" id="wrapper">
  <!-- header start -->
  <div class="header">
    <div class="op lt"><a href="javascript:history.back(-1);"><i class="f20 iconfont">&#xe602;</i></a></div>
    <h2>反馈详情</h2>
  </div>
  <!-- header end -->
  <div class="feedback module cut">
    <div class="details">
      <dl class="col"><dt>主题：</dt><dd><{$feedback.subject}></dd></dl>
      <dl class="col"><dt>类型：</dt><dd><{$feedback.type}></font></dd></dl>
      <dl class="col"><dt>内容：</dt><dd class="c555"><{$feedback.content}></dd></dl>
      <dl class="col"><dt>联系手机：</dt><dd><{$feedback.mobile}></dd></dl>
      <dl class="col"><dt>提交日期：</dt><dd class="c999"><{date('Y年m月d日 H:i:s', $feedback.created_date)}></dd></dl>
    </div>
    <div class="message mt10 cut">
      <div class="th"><i class="iconfont">&#xe630;</i>消息记录</div>
      <div class="module mt8 cut" id="msgli">
        <{if !empty($message_list)}>
        <{foreach $message_list as $v}>
        <dl><dt><{if empty($v.admin_id)}>您<{else}><span>客服<span><{/if}><font><{date('Y-m-d H:i:s', $v.dateline)}></font></dt><dd><{$v.content}></dd></dl>
        <{/foreach}>
        <{else}>
        <p class="nodata caaa">暂无消息记录</p>
        <{/if}>
      </div>
    </div>
  </div>
</div>
<div class="footact" id="footact">
  <div class="repbar cut">
    <div class="frmsg"><a class="inbtn" onClick="sendMessage()">发送</a><input id="send-content" type="text" /></div>
  </div>
</div>
<script type="text/template" id="msg-tpl">
<dl><dt>您<font>${dateline}</font></dt><dd>${content}</dd></dl>
</script>
<script type="text/javascript" src="<{$common.baseurl}>/public/script/juicer.js"></script>
</body>
</html>